how to get data from an api in